import numpy as np

def compress_model(model, compression_ratio=0.5):
    """
    压缩模型
    :param model: 模型参数
    :param compression_ratio: 压缩比例
    :return: 压缩后的模型
    """
    threshold = np.percentile(np.abs(model), compression_ratio * 100)
    compressed_model = np.where(np.abs(model) > threshold, model, 0)
    return compressed_model

# 示例
model = np.random.randn(100)
compressed_model = compress_model(model)
print(f"Compressed model: {compressed_model}")